<template>
<div class="com-course">
  <div class="nav">
      <div class="dropdown" >
          <div class="dropdown__description f-icon-font i-v-bottom" @click="showMask">综合排序</div>
      </div>
      <div class="dropdown" >
          <div class="dropdown__description f-icon-font i-v-bottom" @click="showMask">产品策划</div>
      </div>
      <div class="dropdown" >
          <div class="dropdown__description f-icon-font i-v-bottom" @click="showMask">筛选</div>
      </div>
  </div>
  <div class="mask" v-show="display">
    <menu-left></menu-left>
    <router-view></router-view>
  </div>
  <div  class="related-container" v-show="display" >
    <div class="teacher-recom" style="display:block">
      <ul class="teacher-recom__list">
        <router-link to="/Course/Info">
          <li class="course list-view__item" v-for="item in recomList">
            <div class="course__cover">
              <img :src="item.img" alt="">
              <span class="course__cover-tips course__cover-tips--status">{{item.status}}</span>
            </div>
            <h3 class="course__name">{{item.name}}</h3>
            <p class="course__info">
              <span class="course__info-item u-message">{{item.info}}</span>
            </p>
            <p class="course__info-item u-price z-free">{{item.price}}</p>
          </li>
        </router-link>
      </ul>
      </div>
  </div>
  <div  class="related-container1" v-show="!display">
    <div class="teacher-recom" style="display:block">
      <ul class="teacher-recom__list">
        <router-link to="/Course/Info">
          <li class="course list-view__item" v-for="item in recomList">
            <div class="course__cover">
              <img :src="item.img" alt="">
              <span class="course__cover-tips course__cover-tips--status">{{item.status}}</span>
            </div>
            <h3 class="course__name">{{item.name}}</h3>
            <p class="course__info">
              <span class="course__info-item u-message">{{item.info}}</span>
            </p>
            <p class="course__info-item u-price z-free">{{item.price}}</p>
          </li>
        </router-link>
      </ul>
      </div>
  </div>
</div>
</template>

<script>
import menuLeft from './menuLeft.vue'
// import { mapGetters,mapState,mapMutations } from 'vuex'
export default {
  mounted () {
    this.axios.get('https://www.easy-mock.com/mock/5943d53a8ac26d795f1c9a61/tencent/recomList')
      .then((response) => {
        this.recomList = response.data.recomList
        // console.log(this.recomList)
      })
      .catch((error) => {
        console.log(error)
      })
  },
  data () {
    return {
      recomList: [],
      display: false
    }
  },
  methods: {
    showMask () {
      this.display = !this.display
    }
  },
  components: {
    menuLeft
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
a{
  color:#000;
  text-decoration: none;
}
a:active,a:visited{
  /*background-color: #fff;*/
  /*color:#188eee;*/
}
.nav {
    display: -webkit-box;
    position: fixed;
    /*top: 0;*/
    left: 0;
    z-index: 10000;
    width: 100%;
    width: 100%;
    font-size: 14px;
    background-color: #fff;
}
.dropdown {
    overflow: hidden;
    -webkit-box-flex: 1;
    position: relative;
    box-sizing: content-box;
    min-width: 100px;
    height: 41px;
    line-height: 41px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 0 1px #ededed;
}
.dropdown__description {
    overflow: hidden;
    margin: 0 auto;
    padding-right: 9px;
    max-width: 70px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.dropdown__description:before {
    position: absolute;
    top: 14px;
    right: 15px;
    font-family: mfont;
    font-size: 12px;
    line-height: 12px;
    color: #8e8e8e;
    -webkit-font-smoothing: antialiased;
}
.i-v-bottom:before {
    content: "\f005";
}
/*mask*/
.related-container{
    width:100%;
    height:100%;
    background-color: rgba(0,0,0,.3);
    position:absolute;
    top:60px;
    left:0;
    z-index:2;
    opacity:1;
    filter: alpha(opacity=30);
}
.related-container1{
    width:100%;
    height:100%;
    /*background-color: rgba(0,0,0,.3);*/
    position:absolute;
    top:30px;
    left:0;
    z-index:2;
    opacity:1;
    filter: alpha(opacity=30);
}
/*related-container*/
.mask {
   width:100%;
    height:332px;
    background-color:#fff;    
    /*margin: auto;*/
    position: absolute;
    z-index:3;
    top: 100px;
    bottom: 0;
    left: 0;
    right: 0;
}
.menu-mt{
  display: inline-block;
  float:left;
  width: 90px;
  height: 100%;
  background:#f2f2f4;
}
.dropdown__item {
    height: 46px;
    max-height: 46px;
    line-height: 50px;
    overflow: hidden;
    position: relative;
    padding-left: 12px;
    height: 47px;
    max-height: 47px;
    font-size: 14px;
    line-height: 47px;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: break-all;
}
.dropdown__item:before {
    font-family: mfont;
    font-size: 20px;
    line-height: 20px;
    color: #a2a19f;
    -webkit-font-smoothing: antialiased;
    display: block;
    position: absolute;
    top: 50%;
    left: 12px;
    margin-top: -10px;
    width: 20px;
    height: 20px;
}
.teacher-recom{
  margin-bottom: 10px;
  /*background: #fff;*/
  position: relative;
  top:40px;
  width: 100%;
  height:100%;
}
.rel-class__title {
    padding: 10px 15px 0;
    position: absolute;
    margin: 10px 0;
    font-size: 18px;
    line-height: 25px;
    color: #000;
    text-align: left;
}
.teacher-recom__list{
  position: absolute;
  top:40px;
  text-align: left;
}
.course {
  
    position: relative;
    padding: 15px 15px 15px 166px;
    height: 80px;
    line-height: 20px;
    /*background: #fff;*/
}
.course__cover-tips {
    position: absolute;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
    color: #fff;
    background-color: rgba(0,0,0,.7);
}

.course__cover-tips--status {
    bottom: 0;
    left: 0;
    width: 100%;
    text-indent: 4px;
}
.course__cover {
    overflow: hidden;
    position: absolute;
    top: 15px;
    left: 15px;
    border-radius: 4px;
    width: 140px;
    height: 80px;
}
.course__cover img{
    width: 140px;
    height: 80px;
    background-size: 140px 80px;
}
.course__name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    height: 40px;
    width: 100%;
    max-height: 40px;
    font-size: 16px;
    line-height: 20px;
    white-space: inherit;
    white-space: pre-wrap;
    text-overflow: ellipsis;
    word-break: break-word;
    -webkit-line-clamp: 2;
}
.course__info {
    overflow: hidden;
    margin: 1px 0;
    max-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: break-all;
}
.u-message {
    display: inline-block;
    margin-right: 20px;
    height: 12px;
    font-size: 12px;
    line-height: 12px;
    color: #bbb;
}
.u-price.z-free {
    color: #5fb41b;
    font-size: 16px;
}
ul {
  list-style: none;
}


</style>
